public class ThreadDemo_构造方法 {
    public static void main(String[] args) {
        // 1.创建线程对象
        Thread thread1 = new Thread() {
            @Override
            public void run() {
                super.run();
            }
        };

        // 使用Runnable对象创建线程对象
        Thread thread2 = new Thread(new Runnable() {
            @Override
            public void run() {

            }
        });

        // 创建线程对象，并命名
        Thread thread3 = new Thread("我是线程3") {
            @Override
            public void run() {
                super.run();
            }
        };

        // 使用Runnable对象创建线程对象 并命名
        Thread thread4 = new Thread(new Runnable() {
            @Override
            public void run() {

            }
        },"我是线程4");

        // 线程分组
        ThreadGroup group = new ThreadGroup("我是分组线程");

        Thread t1 = new Thread(group, new Runnable() {
            @Override
            public void run() {

            }
        });

        Thread t2 = new Thread(group, new Runnable() {
            @Override
            public void run() {

            }
        });
    }
}
